<template>
    <div class="container">

        <div class="body_wrap">

            <el-card shadow="hover" ref="content_card">

                <!-- 基本搜索+功能按钮 -->
                <el-form ref="searchForm1" :inline="true" :model="searchForm" size="medium" label-width="">
                    <el-card class="table_tool_bar_wrap" shadow="never">
                        <div class="base_wrap">
                            <div class="left">
                                <el-form-item label="关键字搜索" prop="keyword">
                                    <el-input placeholder="" v-model="searchForm.keyword" clearable/>
                                </el-form-item>
                                <el-button @click="handleSearch" type="primary" size="medium">搜索</el-button>
                                <el-button @click="handleReset" type="info" plain size="medium">重置</el-button>
                                <el-button type="text" size="medium" @click="searchFlag = !searchFlag">
                                    高级搜索<i class="el-icon--right" :class="searchFlag?'el-icon-arrow-down':'el-icon-arrow-up'"></i>
                                </el-button>
                            </div>

                            <div class="right">
                                <el-button @click="handleAddOrUpdateVisible()" type="primary" size="medium" icon="el-icon-plus">新增</el-button>
                                <el-button @click="handleDelete()" type="danger" size="medium" icon="el-icon-delete" :disabled="selectionRows.length == 0">删除</el-button>
                            </div>
                        </div>
                    </el-card>
                </el-form>

                <!-- 高级搜索 -->
                <el-form ref="searchForm2" :inline="true" :model="searchForm" size="medium" label-width="120px">
                    <el-collapse-transition>
                        <el-card class="where_wrap" shadow="never" v-if="!searchFlag">
                            <el-row>
                                <el-col :span="8">
                                    <el-form-item label="会员ID" prop="memberId">
                                        <el-input placeholder="" v-model="searchForm.memberId" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="用户名" prop="memberUsername">
                                        <el-input placeholder="" v-model="searchForm.memberUsername" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="使用的优惠券" prop="couponId">
                                        <el-input placeholder="" v-model="searchForm.couponId" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="订单总额" prop="totalAmount">
                                        <el-input placeholder="" v-model="searchForm.totalAmount" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="应付总额" prop="payAmount">
                                        <el-input placeholder="" v-model="searchForm.payAmount" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="运费金额" prop="freightAmount">
                                        <el-input placeholder="" v-model="searchForm.freightAmount" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="促销优惠金额（促销价、满减、阶梯价）" prop="promotionAmount">
                                        <el-input placeholder="" v-model="searchForm.promotionAmount" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="积分抵扣金额" prop="integrationAmount">
                                        <el-input placeholder="" v-model="searchForm.integrationAmount" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="优惠券抵扣金额" prop="couponAmount">
                                        <el-input placeholder="" v-model="searchForm.couponAmount" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="后台调整订单使用的折扣金额" prop="discountAmount">
                                        <el-input placeholder="" v-model="searchForm.discountAmount" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="订单类型：0->实物订单，2->非实物订单（非实物订单不享受任何折扣），3->活动订单" prop="orderType">
                                        <el-input placeholder="" v-model="searchForm.orderType" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="支付方式：1->支付宝；2->微信；3->银联； 4->货到付款" prop="payType">
                                        <el-input placeholder="" v-model="searchForm.payType" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="订单来源：0->PC订单；1->微信订单，2->APP订单" prop="sourceType">
                                        <el-input placeholder="" v-model="searchForm.sourceType" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="订单状态：0->待付款；1->待发货；2->已发货；3->已完成；4->已关闭；" prop="status">
                                        <el-input placeholder="" v-model="searchForm.status" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="是否支付：0->未支付，1->已支付" prop="isPay">
                                        <el-input placeholder="" v-model="searchForm.isPay" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="申请退款：0->否，1->是" prop="isRefund">
                                        <el-input placeholder="" v-model="searchForm.isRefund" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="收货方式：0->送货上门，2->自提" prop="deliverType">
                                        <el-input placeholder="" v-model="searchForm.deliverType" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="物流公司" prop="deliveryCompany">
                                        <el-input placeholder="" v-model="searchForm.deliveryCompany" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="物流单号" prop="deliverySn">
                                        <el-input placeholder="" v-model="searchForm.deliverySn" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="自动确认时间（天）" prop="autoConfirmDay">
                                        <el-input placeholder="" v-model="searchForm.autoConfirmDay" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="可以获得的积分" prop="integration">
                                        <el-input placeholder="" v-model="searchForm.integration" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="可以获得的成长值" prop="growth">
                                        <el-input placeholder="" v-model="searchForm.growth" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="发票类型：0->不开发票；1->电子发票；2->纸质发票" prop="billType">
                                        <el-input placeholder="" v-model="searchForm.billType" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="发票抬头" prop="billHeader">
                                        <el-input placeholder="" v-model="searchForm.billHeader" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="发票内容" prop="billContent">
                                        <el-input placeholder="" v-model="searchForm.billContent" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="收票人电话" prop="billReceiverPhone">
                                        <el-input placeholder="" v-model="searchForm.billReceiverPhone" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="收票人邮箱" prop="billReceiverEmail">
                                        <el-input placeholder="" v-model="searchForm.billReceiverEmail" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="收货人姓名" prop="receiverName">
                                        <el-input placeholder="" v-model="searchForm.receiverName" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="收货人电话" prop="receiverPhone">
                                        <el-input placeholder="" v-model="searchForm.receiverPhone" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="收货人邮编" prop="receiverPostCode">
                                        <el-input placeholder="" v-model="searchForm.receiverPostCode" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="省份/直辖市" prop="receiverProvince">
                                        <el-input placeholder="" v-model="searchForm.receiverProvince" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="城市" prop="receiverCity">
                                        <el-input placeholder="" v-model="searchForm.receiverCity" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="区" prop="receiverRegion">
                                        <el-input placeholder="" v-model="searchForm.receiverRegion" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="详细地址" prop="receiverDetailAddress">
                                        <el-input placeholder="" v-model="searchForm.receiverDetailAddress" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="订单备注" prop="note">
                                        <el-input placeholder="" v-model="searchForm.note" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="下单时使用的积分" prop="useIntegration">
                                        <el-input placeholder="" v-model="searchForm.useIntegration" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="支付完成时间" prop="paymentTime">
                                        <el-input placeholder="" v-model="searchForm.paymentTime" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="微信支付成功返回的订单号" prop="transactionId">
                                        <el-input placeholder="" v-model="searchForm.transactionId" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="发货时间" prop="deliveryTime">
                                        <el-input placeholder="" v-model="searchForm.deliveryTime" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="确认收货时间" prop="receiveTime">
                                        <el-input placeholder="" v-model="searchForm.receiveTime" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="评价时间" prop="commentTime">
                                        <el-input placeholder="" v-model="searchForm.commentTime" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="订单附加信息" prop="extraJson">
                                        <el-input placeholder="" v-model="searchForm.extraJson" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="确认收货状态[0->未确认；1->已确认]" prop="confirmStatus">
                                        <el-input placeholder="" v-model="searchForm.confirmStatus" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="删除状态【0->未删除；1->已删除】" prop="deleteStatus">
                                        <el-input placeholder="" v-model="searchForm.deleteStatus" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="创建时间" prop="ctime">
                                        <el-input placeholder="" v-model="searchForm.ctime" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="最后更新时间" prop="utime">
                                        <el-input placeholder="" v-model="searchForm.utime" clearable/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="状态" prop="status">
                                        <el-select placeholder="" v-model="searchForm.status" clearable>
                                            <el-option label="正常" value="1"></el-option>
                                            <el-option label="禁用" value="2"></el-option>
                                        </el-select>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                        </el-card>
                    </el-collapse-transition>
                </el-form>

                <!-- 表格工具栏 -->
                <div class="table_min_tools">
                    <TableTools
                        :columnList.sync="columnList"
                        @handleCheckAllChange="handleCheckAllChange"
                        @handleFullscreen="handleFullscreen('content_card')"
                        @handleReload="handleReload"
                        @handleStripe="handleStripe"/>
                </div>

                <!-- 表格 -->
                <el-table
                    ref="table"
                    size="medium"
                    height="500"
                    empty-text="暂无数据"
                    element-loading-text="给我一点时间"
                    fit border highlight-current-row
                    :stripe="stripe"
                    v-loading="loading"
                    :data="dataList"
                    @selection-change="handleSelection">

                    <el-table-column type="selection" width="55" prop="selection" v-if="isHideColumn('selection')" align="center"></el-table-column>
                    <el-table-column label="序号" type="index" prop="index" v-if="isHideColumn('index')" width="60" align="center" />
                    <el-table-column label="会员ID" prop="memberId" v-if="isHideColumn('memberId')" align="left" show-overflow-tooltip/>
                    <el-table-column label="用户名" prop="memberUsername" v-if="isHideColumn('memberUsername')" align="left" show-overflow-tooltip/>
                    <el-table-column label="使用的优惠券" prop="couponId" v-if="isHideColumn('couponId')" align="left" show-overflow-tooltip/>
                    <el-table-column label="订单总额" prop="totalAmount" v-if="isHideColumn('totalAmount')" align="left" show-overflow-tooltip/>
                    <el-table-column label="应付总额" prop="payAmount" v-if="isHideColumn('payAmount')" align="left" show-overflow-tooltip/>
                    <el-table-column label="运费金额" prop="freightAmount" v-if="isHideColumn('freightAmount')" align="left" show-overflow-tooltip/>
                    <el-table-column label="促销优惠金额（促销价、满减、阶梯价）" prop="promotionAmount" v-if="isHideColumn('promotionAmount')" align="left" show-overflow-tooltip/>
                    <el-table-column label="积分抵扣金额" prop="integrationAmount" v-if="isHideColumn('integrationAmount')" align="left" show-overflow-tooltip/>
                    <el-table-column label="优惠券抵扣金额" prop="couponAmount" v-if="isHideColumn('couponAmount')" align="left" show-overflow-tooltip/>
                    <el-table-column label="后台调整订单使用的折扣金额" prop="discountAmount" v-if="isHideColumn('discountAmount')" align="left" show-overflow-tooltip/>
                    <el-table-column label="订单类型：0->实物订单，2->非实物订单（非实物订单不享受任何折扣），3->活动订单" prop="orderType" v-if="isHideColumn('orderType')" align="left" show-overflow-tooltip/>
                    <el-table-column label="支付方式：1->支付宝；2->微信；3->银联； 4->货到付款" prop="payType" v-if="isHideColumn('payType')" align="left" show-overflow-tooltip/>
                    <el-table-column label="订单来源：0->PC订单；1->微信订单，2->APP订单" prop="sourceType" v-if="isHideColumn('sourceType')" align="left" show-overflow-tooltip/>
                    <el-table-column label="订单状态：0->待付款；1->待发货；2->已发货；3->已完成；4->已关闭；" prop="status" v-if="isHideColumn('status')" align="left" show-overflow-tooltip/>
                    <el-table-column label="是否支付：0->未支付，1->已支付" prop="isPay" v-if="isHideColumn('isPay')" align="left" show-overflow-tooltip/>
                    <el-table-column label="申请退款：0->否，1->是" prop="isRefund" v-if="isHideColumn('isRefund')" align="left" show-overflow-tooltip/>
                    <el-table-column label="收货方式：0->送货上门，2->自提" prop="deliverType" v-if="isHideColumn('deliverType')" align="left" show-overflow-tooltip/>
                    <el-table-column label="物流公司" prop="deliveryCompany" v-if="isHideColumn('deliveryCompany')" align="left" show-overflow-tooltip/>
                    <el-table-column label="物流单号" prop="deliverySn" v-if="isHideColumn('deliverySn')" align="left" show-overflow-tooltip/>
                    <el-table-column label="自动确认时间（天）" prop="autoConfirmDay" v-if="isHideColumn('autoConfirmDay')" align="left" show-overflow-tooltip/>
                    <el-table-column label="可以获得的积分" prop="integration" v-if="isHideColumn('integration')" align="left" show-overflow-tooltip/>
                    <el-table-column label="可以获得的成长值" prop="growth" v-if="isHideColumn('growth')" align="left" show-overflow-tooltip/>
                    <el-table-column label="发票类型：0->不开发票；1->电子发票；2->纸质发票" prop="billType" v-if="isHideColumn('billType')" align="left" show-overflow-tooltip/>
                    <el-table-column label="发票抬头" prop="billHeader" v-if="isHideColumn('billHeader')" align="left" show-overflow-tooltip/>
                    <el-table-column label="发票内容" prop="billContent" v-if="isHideColumn('billContent')" align="left" show-overflow-tooltip/>
                    <el-table-column label="收票人电话" prop="billReceiverPhone" v-if="isHideColumn('billReceiverPhone')" align="left" show-overflow-tooltip/>
                    <el-table-column label="收票人邮箱" prop="billReceiverEmail" v-if="isHideColumn('billReceiverEmail')" align="left" show-overflow-tooltip/>
                    <el-table-column label="收货人姓名" prop="receiverName" v-if="isHideColumn('receiverName')" align="left" show-overflow-tooltip/>
                    <el-table-column label="收货人电话" prop="receiverPhone" v-if="isHideColumn('receiverPhone')" align="left" show-overflow-tooltip/>
                    <el-table-column label="收货人邮编" prop="receiverPostCode" v-if="isHideColumn('receiverPostCode')" align="left" show-overflow-tooltip/>
                    <el-table-column label="省份/直辖市" prop="receiverProvince" v-if="isHideColumn('receiverProvince')" align="left" show-overflow-tooltip/>
                    <el-table-column label="城市" prop="receiverCity" v-if="isHideColumn('receiverCity')" align="left" show-overflow-tooltip/>
                    <el-table-column label="区" prop="receiverRegion" v-if="isHideColumn('receiverRegion')" align="left" show-overflow-tooltip/>
                    <el-table-column label="详细地址" prop="receiverDetailAddress" v-if="isHideColumn('receiverDetailAddress')" align="left" show-overflow-tooltip/>
                    <el-table-column label="订单备注" prop="note" v-if="isHideColumn('note')" align="left" show-overflow-tooltip/>
                    <el-table-column label="下单时使用的积分" prop="useIntegration" v-if="isHideColumn('useIntegration')" align="left" show-overflow-tooltip/>
                    <el-table-column label="支付完成时间" prop="paymentTime" v-if="isHideColumn('paymentTime')" align="left" show-overflow-tooltip/>
                    <el-table-column label="微信支付成功返回的订单号" prop="transactionId" v-if="isHideColumn('transactionId')" align="left" show-overflow-tooltip/>
                    <el-table-column label="发货时间" prop="deliveryTime" v-if="isHideColumn('deliveryTime')" align="left" show-overflow-tooltip/>
                    <el-table-column label="确认收货时间" prop="receiveTime" v-if="isHideColumn('receiveTime')" align="left" show-overflow-tooltip/>
                    <el-table-column label="评价时间" prop="commentTime" v-if="isHideColumn('commentTime')" align="left" show-overflow-tooltip/>
                    <el-table-column label="订单附加信息" prop="extraJson" v-if="isHideColumn('extraJson')" align="left" show-overflow-tooltip/>
                    <el-table-column label="确认收货状态[0->未确认；1->已确认]" prop="confirmStatus" v-if="isHideColumn('confirmStatus')" align="left" show-overflow-tooltip/>
                    <el-table-column label="删除状态【0->未删除；1->已删除】" prop="deleteStatus" v-if="isHideColumn('deleteStatus')" align="left" show-overflow-tooltip/>
                    <el-table-column label="创建时间" prop="ctime" v-if="isHideColumn('ctime')" align="left" show-overflow-tooltip/>
                    <el-table-column label="最后更新时间" prop="utime" v-if="isHideColumn('utime')" align="left" show-overflow-tooltip/>
                    <el-table-column label="状态" align="center" width="80px">
                        <template slot-scope="scope">
                            <el-tag type="success" size="small" v-if="scope.row.status === 1">正常</el-tag>
                            <el-tag type="danger" size="small" v-else>禁用</el-tag>
                        </template>
                    </el-table-column>

                    <el-table-column label="操作" prop="btn" v-if="isHideColumn('btn')" width="200px" align="left" fixed="right">
                        <template slot-scope="scope">
                            <el-button @click="handleAddOrUpdateVisible(scope.row.id)" type="text" size="small">编辑</el-button>
                            <el-button @click="handleDelete(scope.row)" type="text" size="small">删除</el-button>
                            <el-button @click="handleDrawerVisible(scope.row)" type="text" size="small">详情</el-button>
                        </template>
                    </el-table-column>

                </el-table>

                <!-- 分页 -->
                <TablePagination
                    :total.sync="total"
                    :page.sync="searchForm.page"
                    :limit.sync="searchForm.limit"
                    @handleSizeChange="handleSizeChange"
                    @handleCurrentChange="handleCurrentChange"/>
            </el-card>

            <!-- 弹窗, 新增 / 修改 -->
            <AddOrUpdate ref="addOrUpdate" @refreshDataList="getDataList"></AddOrUpdate>

            <!-- 右侧抽屉,详情信息 -->
            <el-drawer
                class="drawer_wrap"
                size="800px"
                :visible.sync="drawerVisible"
                :with-header="false"
                :modal="true"
                direction="rtl"
                :before-close="handleCloseDrawerDetail">
                <div class="header_title">{{detail.realname}}</div>

                <div class="header_body">
                    <el-form :model="detail" :inline="true" label-width="120">
                        <el-row>
                            <el-col :span="12">
                                <el-form-item label="姓名：">
                                    {{detail.realname}}
                                </el-form-item>
                            </el-col>
                            <el-col :span="12">
                                <el-form-item label="姓名：">
                                    {{detail.username}}
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-form-item label="会员ID：">
                            {{detail.memberId}}
                        </el-form-item>
                        <el-form-item label="用户名：">
                            {{detail.memberUsername}}
                        </el-form-item>
                        <el-form-item label="使用的优惠券：">
                            {{detail.couponId}}
                        </el-form-item>
                        <el-form-item label="订单总额：">
                            {{detail.totalAmount}}
                        </el-form-item>
                        <el-form-item label="应付总额：">
                            {{detail.payAmount}}
                        </el-form-item>
                        <el-form-item label="运费金额：">
                            {{detail.freightAmount}}
                        </el-form-item>
                        <el-form-item label="促销优惠金额（促销价、满减、阶梯价）：">
                            {{detail.promotionAmount}}
                        </el-form-item>
                        <el-form-item label="积分抵扣金额：">
                            {{detail.integrationAmount}}
                        </el-form-item>
                        <el-form-item label="优惠券抵扣金额：">
                            {{detail.couponAmount}}
                        </el-form-item>
                        <el-form-item label="后台调整订单使用的折扣金额：">
                            {{detail.discountAmount}}
                        </el-form-item>
                        <el-form-item label="订单类型：0->实物订单，2->非实物订单（非实物订单不享受任何折扣），3->活动订单：">
                            {{detail.orderType}}
                        </el-form-item>
                        <el-form-item label="支付方式：1->支付宝；2->微信；3->银联； 4->货到付款：">
                            {{detail.payType}}
                        </el-form-item>
                        <el-form-item label="订单来源：0->PC订单；1->微信订单，2->APP订单：">
                            {{detail.sourceType}}
                        </el-form-item>
                        <el-form-item label="订单状态：0->待付款；1->待发货；2->已发货；3->已完成；4->已关闭；：">
                            {{detail.status}}
                        </el-form-item>
                        <el-form-item label="是否支付：0->未支付，1->已支付：">
                            {{detail.isPay}}
                        </el-form-item>
                        <el-form-item label="申请退款：0->否，1->是：">
                            {{detail.isRefund}}
                        </el-form-item>
                        <el-form-item label="收货方式：0->送货上门，2->自提：">
                            {{detail.deliverType}}
                        </el-form-item>
                        <el-form-item label="物流公司：">
                            {{detail.deliveryCompany}}
                        </el-form-item>
                        <el-form-item label="物流单号：">
                            {{detail.deliverySn}}
                        </el-form-item>
                        <el-form-item label="自动确认时间（天）：">
                            {{detail.autoConfirmDay}}
                        </el-form-item>
                        <el-form-item label="可以获得的积分：">
                            {{detail.integration}}
                        </el-form-item>
                        <el-form-item label="可以获得的成长值：">
                            {{detail.growth}}
                        </el-form-item>
                        <el-form-item label="发票类型：0->不开发票；1->电子发票；2->纸质发票：">
                            {{detail.billType}}
                        </el-form-item>
                        <el-form-item label="发票抬头：">
                            {{detail.billHeader}}
                        </el-form-item>
                        <el-form-item label="发票内容：">
                            {{detail.billContent}}
                        </el-form-item>
                        <el-form-item label="收票人电话：">
                            {{detail.billReceiverPhone}}
                        </el-form-item>
                        <el-form-item label="收票人邮箱：">
                            {{detail.billReceiverEmail}}
                        </el-form-item>
                        <el-form-item label="收货人姓名：">
                            {{detail.receiverName}}
                        </el-form-item>
                        <el-form-item label="收货人电话：">
                            {{detail.receiverPhone}}
                        </el-form-item>
                        <el-form-item label="收货人邮编：">
                            {{detail.receiverPostCode}}
                        </el-form-item>
                        <el-form-item label="省份/直辖市：">
                            {{detail.receiverProvince}}
                        </el-form-item>
                        <el-form-item label="城市：">
                            {{detail.receiverCity}}
                        </el-form-item>
                        <el-form-item label="区：">
                            {{detail.receiverRegion}}
                        </el-form-item>
                        <el-form-item label="详细地址：">
                            {{detail.receiverDetailAddress}}
                        </el-form-item>
                        <el-form-item label="订单备注：">
                            {{detail.note}}
                        </el-form-item>
                        <el-form-item label="下单时使用的积分：">
                            {{detail.useIntegration}}
                        </el-form-item>
                        <el-form-item label="支付完成时间：">
                            {{detail.paymentTime}}
                        </el-form-item>
                        <el-form-item label="微信支付成功返回的订单号：">
                            {{detail.transactionId}}
                        </el-form-item>
                        <el-form-item label="发货时间：">
                            {{detail.deliveryTime}}
                        </el-form-item>
                        <el-form-item label="确认收货时间：">
                            {{detail.receiveTime}}
                        </el-form-item>
                        <el-form-item label="评价时间：">
                            {{detail.commentTime}}
                        </el-form-item>
                        <el-form-item label="订单附加信息：">
                            {{detail.extraJson}}
                        </el-form-item>
                        <el-form-item label="确认收货状态[0->未确认；1->已确认]：">
                            {{detail.confirmStatus}}
                        </el-form-item>
                        <el-form-item label="删除状态【0->未删除；1->已删除】：">
                            {{detail.deleteStatus}}
                        </el-form-item>
                        <el-form-item label="创建时间：">
                            {{detail.ctime}}
                        </el-form-item>
                        <el-form-item label="最后更新时间：">
                            {{detail.utime}}
                        </el-form-item>
                    </el-form>
                </div>
            </el-drawer>

        </div>
    </div>
</template>

<script>
import TableMixin from '@/mixin/TableMixin'
import TableTools from '@/views/components/table/table-tools'
import TablePagination from '@/views/components/table/table-pagination'
import AddOrUpdate from './add-or-update-dialog'
export default {
    mixins: [TableMixin],
    components: {
        TableTools,
        TablePagination,
        AddOrUpdate
    },

    data() {
        return {
            dataList: [],
            total: 0,
            loading: false,
            drawerVisible: false,
            selectionRows: [],
            searchFlag: true,
            searchForm: {
                page: 1,
                limit: 10,
                sortColumns: null,
                sortType: null,
                keyword: null,
                memberId: null,
                memberUsername: null,
                couponId: null,
                totalAmount: null,
                payAmount: null,
                freightAmount: null,
                promotionAmount: null,
                integrationAmount: null,
                couponAmount: null,
                discountAmount: null,
                orderType: null,
                payType: null,
                sourceType: null,
                status: null,
                isPay: null,
                isRefund: null,
                deliverType: null,
                deliveryCompany: null,
                deliverySn: null,
                autoConfirmDay: null,
                integration: null,
                growth: null,
                billType: null,
                billHeader: null,
                billContent: null,
                billReceiverPhone: null,
                billReceiverEmail: null,
                receiverName: null,
                receiverPhone: null,
                receiverPostCode: null,
                receiverProvince: null,
                receiverCity: null,
                receiverRegion: null,
                receiverDetailAddress: null,
                note: null,
                useIntegration: null,
                paymentTime: null,
                transactionId: null,
                deliveryTime: null,
                receiveTime: null,
                commentTime: null,
                extraJson: null,
                confirmStatus: null,
                deleteStatus: null,
                ctime: null,
                utime: null
            },
            detail: {
                id: null,
                memberId: null,
                memberUsername: null,
                couponId: null,
                totalAmount: null,
                payAmount: null,
                freightAmount: null,
                promotionAmount: null,
                integrationAmount: null,
                couponAmount: null,
                discountAmount: null,
                orderType: null,
                payType: null,
                sourceType: null,
                status: null,
                isPay: null,
                isRefund: null,
                deliverType: null,
                deliveryCompany: null,
                deliverySn: null,
                autoConfirmDay: null,
                integration: null,
                growth: null,
                billType: null,
                billHeader: null,
                billContent: null,
                billReceiverPhone: null,
                billReceiverEmail: null,
                receiverName: null,
                receiverPhone: null,
                receiverPostCode: null,
                receiverProvince: null,
                receiverCity: null,
                receiverRegion: null,
                receiverDetailAddress: null,
                note: null,
                useIntegration: null,
                paymentTime: null,
                transactionId: null,
                deliveryTime: null,
                receiveTime: null,
                commentTime: null,
                extraJson: null,
                confirmStatus: null,
                deleteStatus: null,
                ctime: null,
                utime: null
            }
        }
    },

    created() {
    },

    mounted() {
        this.$nextTick(() => {
            this.getDataList()
        })
    },

    methods: {

        /**
         * 侧边栏抽屉打开
         */
        handleDrawerVisible(row) {
            this.detail = row
            this.drawerVisible = true
        },

        /**
         * 新增或编辑
         */
        handleAddOrUpdateVisible(id) {
            // 表单页面
            // if(!id) {
            //     this.$router.push({name: 'user_form'})
            // } else {
            //     this.$router.push({name: 'user_form', query: {id: id}})
            // }

            // 表单窗口
            this.$nextTick(() => {
                this.$refs.addOrUpdate.init(id)
            })
        },

        /**
         * 删除
         */
        async handleDelete(row) {
            let ids = []
            if (row) {
                ids.push(row.id)
            }
            if(this.selectionRows) {
                this.selectionRows.filter((item, index) => {
                    ids.push(item.id)
                })
            }
            if (ids.length <= 0) {
                this.$notify({ title: '提示', message: '请选择需要删除的记录！', type: 'info' });
            } else {
                const confirm = await this.$confirm('确定要删除？', '提示', { type: 'warning' }).catch(() => {})
                if(confirm) {
                    const res = await this.$http({
                        url: '/mall/omsorder/delete',
                        method: 'POST',
                        data: ids
                    })
                    if (this.ResultMessage(res)) {
                        this.getDataList()
                    }
                }
            }
        },

        /**
         * 获取表格数据
         */
        async getDataList() {
            this.loading = true
            const res = await this.$http({
                url: '/mall/omsorder/page',
                method: 'GET',
                params: this.searchForm
            })
            if (this.ResultMessage(res, false)) {
                this.dataList = res.data.records || []
                this.total = res.data.total
            }
            this.loading = false
        },

        /**
         * 搜索
         */
        handleSearch() {
            this.getDataList()
        },
        /**
         * 重新加载数据表格
         */
        handleReload() {
            this.getDataList()
        },
        /**
         * 重置搜索表单
         */
        handleReset() {
            this.$refs.searchForm1.resetFields()
            this.$refs.searchForm2.resetFields()
        }

    }

}
</script>

<style lang="scss" scoped>

</style>
